home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / lisp / elk-2_0.lha / elk-2.0 / contrib / zelk / include / libz.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-11-12  |  3.7 KB  |  141 lines

  1. /* libz.h zilla library 5aug
  2.  * modified
  3.  * 12nov
  4.  * 7sep
  5.  * 10feb        parseargs
  6.  */
  7.  
  8. #ifndef LIBZ_H
  9. #define LIBZ_H
  10.  
  11. #ifndef THEUSUAL_H
  12. # include <theusual.h>
  13. #endif
  14.  
  15. /*extern*/
  16. #if !Eansiincludes
  17. extern char *malloc();
  18. #endif
  19.  
  20. /*compat*/
  21.  
  22. /* types */
  23. #if Eunix
  24.   typedef long Ztime_t;         /* type for internal time */
  25. #endif
  26. #if Emac
  27.   typedef unsigned int4 Ztime_t;
  28. #endif
  29.  
  30. /* prototypes */
  31. char *Zsalloc Zproto((char *));
  32. bool Zalignedon Zproto((char *,int));
  33. proc Zbeep Zproto((Zvoid));
  34. int4 Zparseargs Zproto((int,char **,...));
  35. proc Zdelay Zproto((int4 secs));
  36. #define Zqargs0 Zparseargs
  37.  
  38. /* prototypes for string lib, if not mapping onto libc */
  39. #ifndef str_len
  40. extern char *str_index Zproto((char *,Dchar));
  41. bool str_eq Zproto((char *,char *));
  42. int4 str_len Zproto((char *));
  43. char *str_cpy Zproto((char *to,char *frm));
  44. char *str_cat Zproto((char *dst,char *add));
  45. #endif /*str_len*/
  46.  
  47. /* these are never mapped onto libz */
  48. extern char *str_rindex Zproto((char *,Dchar));
  49. char *str_end Zproto((char *));
  50. bool str_any Zproto((char *set,char *str));
  51. char *str_alloc Zproto((char *));
  52. int str_prefix Zproto((char *sub,char *str));
  53.  
  54. FILE *Zfopenext Zproto((char *name,char *ext,char *mode,char *errmsg));
  55. int Zopenext Zproto((char *name,char *ext,char *mode,char *errmsg));
  56. char *Zmktemp Zproto((char *template));  /* side effects its arg */
  57. char *Zuniqnam Zproto((char *prefix));
  58.  
  59. char *Zpathop Zproto((char *,Dchar));
  60. char *Zpathdelext Zproto((char *path));
  61. char *Zpathgetext Zproto((char *path));
  62. char *Zpathgetname Zproto((char *path));
  63. char *Zpathgetpath Zproto((char *path));
  64.  
  65. Ztime_t Zfilemodtime Zproto((char *));
  66. Ztime_t Zfileacctime Zproto((char *));
  67. proc Zfilesettimes Zproto((char *,Ztime_t,Ztime_t));
  68. bool Zfileversion(Zvoid);
  69. bool Zversion Zproto((char *,char *));
  70. #define version Zversion
  71. /*#define quit Zquit*/
  72. #define openext Zopenext
  73. #define fopenext Zfopenext
  74.  
  75. /* may cause trouble? */
  76. proc usage Zproto((void));
  77.  
  78. #if (Eansi&&Estdarg)
  79.   proc Zerror Zproto((char *msg,...));
  80.   proc Zfail Zproto((char *,...));
  81.   proc Zcodeerror Zproto((char *,...));
  82.   proc Zwarning Zproto((char *,...));
  83.   proc Zquit Zproto((int,char *,...));
  84. #else
  85.   proc Zerror Zproto((/*...*/));
  86.   proc Zfail Zproto((/*...*/));
  87.   proc Zcodeerror Zproto((/*...*/));
  88.   proc Zwarning Zproto((/*...*/));
  89.   proc Zquit Zproto((int,char *,...));
  90. #endif
  91.  
  92. /*unsigned int4 Zdateint Zproto((void));  renamed to curtime! */
  93. /*proc Zdatestr Zproto((unsigned int4,char *)) replaced by timestring */
  94. Ztime_t Zcurtime Zproto((void));
  95. char *Ztimestring Zproto((Ztime_t));
  96. int4 Zparsetime Zproto((char *));
  97. proc Znap();    /* delay for about 1/60 sec. -where is this?/ */
  98.  
  99. long Zfilesize Zproto((char *path));
  100. long Zifilesize Zproto((int filedes));
  101. #if Eunix
  102. long Zfilesizeext Zproto((char *path,char *ext,char *errmsg));
  103. #endif
  104. bool Zfiledirp Zproto((char *path));
  105. proc Zzerofile Zproto((char *,int4));
  106.  
  107. function *Zshowactivehook Zproto((function *));    /*rtns old*/
  108. proc Zshowactivity Zproto((void));
  109. int Zio_typeahead Zproto((void));
  110. int Zio_getcif Zproto((void));
  111.  
  112. #if Eunix
  113. int Zglob Zproto((char *,char **,int));
  114. #endif
  115.  
  116. #if Emac
  117. /* what is the difference between these and BlockMove?? */
  118. # define Zbzero(adr,len)        memset(adr,0,len)
  119. # define Zbset(adr,len,val)    memset(adr,val,len)
  120. # define Zbcopy(src,dst,len)    memcpy(dst,src,len)
  121. # define Zmemcmp : foo
  122. #endif
  123.  
  124. #if (Ebsd|EsysV)
  125. # define Zbzero(adr,len)    bzero(adr,len)
  126. /*# define Zbset(adr,len,val)    no such! */
  127. # define Zbcopy(src,dst,len)    bcopy(src,dst,len)
  128. # define Zmemcmp(a,b,n)         memcmp(a,b,n)
  129. # if (Eansiincludes&&!Egcc)
  130. #   include <bstring.h>
  131. # else
  132.     proc bcopy Zproto((Zconst Zunspec src,Zunspec dst,int len));
  133.     proc bzero Zproto((Zunspec b,int len));
  134. # endif
  135. #endif
  136.  
  137. proc Zbyteswap_long Zproto((char *));
  138. proc Zbyteswap Zproto((char *));
  139.  
  140. #endif         /*LIBZ_H*/
  141.